﻿<UserControl x:Class="PokemonBattleOnline.PBO.Battle.BattleField2D"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:my="clr-namespace:PokemonBattleOnline.PBO.Battle"
             xmlns:ui="clr-namespace:PokemonBattleOnline.PBO.Elements"
             Height="240" Width="400" UseLayoutRounding="True" SnapsToDevicePixels="True" ClipToBounds="True" RenderOptions.BitmapScalingMode="NearestNeighbor">
    <UserControl.Background>
        <ImageBrush ImageSource="/PBO;component/images/UpperScreen/Terrains/wifi.png"/>
    </UserControl.Background>
    <UserControl.Resources>
        <Style TargetType="ItemsControl">
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Image x:Name="img" Width="14" Height="14"/>
                        <DataTemplate.Triggers>
                            <DataTrigger Binding="{Binding}" Value="Normal">
                                <Setter TargetName="img" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Normal.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding}" Value="Abnormal">
                                <Setter TargetName="img" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Abnormal.png"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding}" Value="Faint">
                                <Setter TargetName="img" Property="Source" Value="/PBO;component/images/UpperScreen/StateBar/Faint.png"/>
                            </DataTrigger>
                        </DataTemplate.Triggers>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Canvas>
        <my:Pokemon2D x:Name="PO1" Canvas.Right="143" Canvas.Top="110"/><!--187, 77-->
        <my:Pokemon2D x:Name="PO0" Canvas.Right="68" Canvas.Top="110"/><!--187, 77-->
        <my:Pokemon2D x:Name="P0" Canvas.Left="68" Canvas.Top="200"/>
        <my:Pokemon2D x:Name="P1" Canvas.Left="218" Canvas.Top="200"/>
        <StackPanel Orientation="Horizontal" Width="93" Canvas.Right="0" Canvas.Top="30">
            <StackPanel.Background>
                <ImageBrush ImageSource="/PBO;component/images/UpperScreen/StateBar/Team.png">
                    <ImageBrush.Transform>
                        <MatrixTransform>
                            <MatrixTransform.Matrix>
                                <Matrix M11="-1" M22="1" OffsetX="93"/>
                            </MatrixTransform.Matrix>
                        </MatrixTransform>
                    </ImageBrush.Transform>
                </ImageBrush>
            </StackPanel.Background>
            <ItemsControl Name="PlayerO1" Margin="7,0,0,0"/>
            <ItemsControl Name="PlayerO0"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Width="93" Canvas.Top="169">
            <StackPanel.Background>
                <ImageBrush ImageSource="/PBO;component/images/UpperScreen/StateBar/Team.png"/>
            </StackPanel.Background>
            <ItemsControl Name="Player0" Margin="2,0,0,0"/>
            <ItemsControl Name="Player1"/>
        </StackPanel>
    </Canvas>
</UserControl>
